package com.zx.cloud.config;

import org.quartz.SchedulerException;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

/**
 * @author Alex
 */
@Configuration
public class BeanConfiguration {

    @Bean
    public SchedulerFactoryBean getSchedulerFactoryBean() throws SchedulerException {
        SchedulerFactoryBean factoryBean = new SchedulerFactoryBean();
        factoryBean.setConfigLocation(new ClassPathResource("quartz.properties"));
        factoryBean.setStartupDelay(2);
        factoryBean.setAutoStartup(true);
        return factoryBean;
    }
    
}
